package fanxing;

import java.util.*;

public class Hashset {
    public static void main(String[] args) {
        HashMap<Student, String> hashSet = new HashMap<>();
        hashSet.put(new Student(("张三"), 18), "武汉");
        hashSet.put(new Student(("张三三"), 28), "湖北");
        hashSet.put(new Student(("张三四"), 129), "四川");

        Set<Student> students = hashSet.keySet();
        for (Student student : students) {
            String s = hashSet.get(student);
            System.out.println(student + "-----" + s);
        }
        System.out.println("==================================");
        Set<Map.Entry<Student, String>> entries = hashSet.entrySet();
        for (Map.Entry<Student, String> entry : entries) {
            Student key = entry.getKey();
            String value = entry.getValue();
            System.out.println(key + "---------" + value);
        }
    }
    }
